import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../../js/UI.js" as Style
Rectangle {
    id: rect
    color: "transparent"
    width: m_root_id.width
    height: m_lineValue*1.5
    signal enterCignal()
    signal  exitClick()
    property alias m_headSource: m_head.m_source
    property alias m_channelname: channelName.text
    property var m_name: ""
    signal acceptSignal()
    HeadImage {
        id: m_head
        width: parent.height*0.8
        height: parent.height*0.8
        anchors.left: parent.left
        anchors.leftMargin: m_lineValue*0.3
        anchors.verticalCenter: parent.verticalCenter
    }
    Column{
        anchors.left: m_head.right
        anchors.leftMargin: 0.2*m_lineValue
        anchors.verticalCenter: parent.verticalCenter
        anchors.right: isadd.right
        spacing: 0.05*m_lineValue
        AText{
            id:channelName
            text: qsTr("%1").arg()
            font.pointSize: 18
            color: "#323232"
        }
        AText{
            id:invitName
            text: qsTr("%1邀请你加入该房间").arg(m_name)
            font.pointSize: 18
            color: "#cccccc"
        }

    }
    Image{
        id:isadd
        anchors.right:  parent.right
        anchors.rightMargin: m_lineValue*0.2
        anchors.verticalCenter: parent.verticalCenter
        width: m_lineValue*0.3
        height: m_lineValue*0.3
        source: "qrc:/images/aroow.svg"
    }
    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: {
            console.log("接收邀请")
            acceptSignal()
           // clickSignal()
        }
//        onPressed:{
//            pressSignal()
//        }
//        onEntered: enterCignal()
//        onExited: exitClick()
//        hoverEnabled:true
    }
    states: State {
        name: "pressed"; when: mouseArea.pressed
        PropertyChanges { target: rect ; color: Style.transparent_color;}
    }
    transitions: Transition {
        ColorAnimation { duration: 50 }
    }
}

